<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var str = "abcba";

      var aa = str.split("").join("");  
        
     var bb=  str.split("").reverse().join("");
     console.log(aa)  
     console.log(bb)

     if(aa===bb){
         console.log(true);
     }else{
         console.log(false)
     }





     
    </script>
  </body>
</html>
